{include file="Public:header2"/}
<body style="min-height: 100%;background-color: #fff">
<div style="padding: 0 20px;position: relative;z-index: 99;border-bottom: 1px solid #e5e5e5;line-height: 39px;height: 39px;overflow: hidden;">
      <span style="visibility: visible;">
         <a href="{:url('/admin/pop')}" style="padding-right: 8px;line-height: 22px;font-size: 14px;color: #333!important;">单页列表<span class="layui-box">&gt;</span></a>
         <a href="javascript:;"> <cite>添加单页</cite></a>
      </span>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body">
          <form onsubmit="return false;">
            <div class="layui-form" wid100 lay-filter="">
              <div class="layui-form-item" >
                <label class="layui-form-label">账户ID</label>
                <div class="layui-input-inline">
                  <input type="number" name="account_id" value="" lay-verify="required" placeholder="广告账户ID" autocomplete="off" class="layui-input" >
                </div>
              </div>

              <div class="layui-form-item">
                <label class="layui-form-label">access token（广告应用中获取）</label>
                <div class="layui-input-block" >
                  <input type="text" class="layui-input" name="access_token" value="">
                </div>
              </div>

              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" onclick="return check()">确认保存</button>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
{include file="Public:footer"/}
</body>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" src="/static/admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
</html>
<script type="text/javascript">
  layui.use(['layer','form','upload','element'], function(){
    var $ = layui.$;

    var form = layui.form;
    var upload = layui.upload;
    var element = layui.element;
  })

  function check(){
    var url="{:url('/admin/ads_add')}";
    var $ = layui.$;
    var load=layer.load(2);
    $.post(url,$("form").serialize(),function(data){
      if(data.status==1){
        layer.msg(data.msg,{icon:1,time:1000},function(){
          // 刷新父级页面
            parent.location.reload();
        });
      }else{
        layer.msg(data.msg,{icon:2,anim:6,time:1500},function(){
          layer.close(load);
        });
      }
    })
  }

</script>
